Zadig 文档
Zadig
教程
博客
论坛
关于
中文英文
Zadig
教程
博客
论坛
关于
Zadig v4.2
Loading...
     编辑文档
     反馈问题
     社区讨论

    本页导航

    Release Plan

    This document mainly introduces how to use Open API to operate Zadig's release plans.

    # Release Plan

    # Get Release Plan List

    Request

    GET /openapi/release_plan/v1
    
    1

    Query

    Parameter NameTypeDescriptionRequiredDefault
    pageNumintPagination parameter - current pageYesNone
    pageSizeintPagination parameter - items per pageYesNone

    Response Description

    Parameter NameTypeDescription
    idstringRelease plan primary key
    namestringRelease plan name
    indexintRelease plan sequence
    managerstringRelease manager
    descriptionstringRequirement association
    create_timeintCreation time
    created_bystringCreator

    Success Response

    {
        "list": [
            {
                "id": "64f58a7ac573f7325c2744b6",
                "index": 31,
                "name": "test-workflow-0904",
                "manager": "admin",
                "description": "",
                "created_by": "admin",
                "create_time": 1693813370
            }
        ],
        "total": 26
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    # Get Release Plan Details

    Request

    GET /openapi/release_plan/v1/:id
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequiredDefault
    idstringRelease plan primary keyYesNone

    Success Response

    {
        "id": "64f1a7cd1b7bd46ec353b50c",
        "index": 21,
        "name": "plan-A",
        "manager": "admin",
        "manager_id": "c565c7eb-e273-11ed-bef9-a659ed9f1ed1",
        "start_time": 1693558721, // Release window
        "end_time": 1694016000,   // Release window
        "schedule_execute_time": 1694016000,   // Schedule execution time
        "description": "",
        "created_by": "admin",
        "create_time": 1693558733,
        "updated_by": "admin",
        "update_time": 1693558750,
        "approval": { // Approval configuration
            "enabled": true,
            "status": "",
            "type": "native",
            "description": "",
            "native_approval": {
                "timeout": 5,
                "approve_users": [
                    {
                        "user_id": "c565c7eb-e273-11ed-bef9-a659ed9f1ed1",
                        "user_name": "admin",
                        "reject_or_approve": "",
                        "comment": "",
                        "operation_time": 0
                    }
                ],
                "needed_approvers": 1,
                "reject_or_approve": "",
                "instance_code": ""
            },
            "lark_approval": {
                "timeout": 5,
                "approval_id": "",
                "default_approval_initiator": null,
                "approve_users": [],
                "approval_nodes": [
                    {
                        "approve_users": [],
                        "type": "AND",
                        "reject_or_approve": ""
                    }
                ],
                "instance_code": ""
            },
            "dingtalk_approval": {
                "timeout": 5,
                "approval_id": "",
                "default_approval_initiator": null,
                "approval_nodes": [
                    {
                        "approve_users": [],
                        "type": "AND",
                        "reject_or_approve": ""
                    }
                ],
                "instance_code": ""
            }
        },
        "jobs": [
            {
                "id": "0b655ad6-5d08-4f1c-8ff6-7eb004c7c7bd",
                "name": "中间件变更",
                "type": "text",
                "spec": {
                    "content": "<p>2222</p><p data-f-id=\"pbf\" style=\"text-align: center; font-size: 14px; margin-top: 30px; opacity: 0.65; font-family: sans-serif;\">Powered by <a href=\"https://www.froala.com/wysiwyg-editor?pb=1\" title=\"Froala Editor\">Froala Editor</a></p>"
                },
                "status": "",
                "last_status": "",
                "updated": true,
                "executed_by": "",
                "executed_time": 0
            }
        ],
        "status": "planning",
        "planning_time": 0,  // Time to complete planning status
        "approval_time": 0,  // Time to complete approval status
        "executing_time": 0, // Time to complete execution status
        "success_time": 0   // Success time
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83

    # Create Release Plan

    Request

    POST /openapi/release_plan/v1
    
    1

    Body Parameter Description

    Parameter NameTypeDescriptionRequiredDefault
    namestringRelease plan nameYesNone
    managerstringRelease manager usernameYesNone
    manager_identity_typestringRelease manager user type: system (default), ldap, oauth, etc.YesNone
    descriptionstringRequirement associationNoNone
    start_timeintRelease window - start timeNoNone
    end_timeintRelease window - end timeNoNone
    schedule_execute_timeintSchedule execution timeNoNone
    approvalapprovalApproval configuration, specific fields can refer to the create custom workflow sectionNoNone

    Body Parameter Example

    {
        "name": "plan-example",
        "manager": "admin",
        "manager_identity_type": "system",
        "start_time": 1693558721, // Release window
        "end_time": 1694016000,   // Release window
        "description": "",
        "approval": { // Approval configuration
            "enabled": true,
            "status": "",
            "type": "native",
            "description": "",
            "native_approval": {
                "timeout": 5,
                "approve_users": [
                    {
                        "user_id": "c565c7eb-e273-11ed-bef9-a659ed9f1ed1",
                        "user_name": "admin",
                        "reject_or_approve": "",
                        "comment": "",
                        "operation_time": 0
                    }
                ],
                "needed_approvers": 1,
                "reject_or_approve": "",
                "instance_code": ""
            }
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29

    Success Response

    {
      "id": "6895627bd3a843cb7423728a"
    }
    
    1
    2
    3

    # Update Release Plan and Jobs

    Request

    PATCH /openapi/release_plan/v1/:id
    
    1

    # Path Parameters

    Parameter NameTypeDescriptionDefaultRequired
    idstringRelease plan idNoneYes

    Body Parameter Description

    Parameter NameTypeDescriptionRequiredDefault
    namestringRelease plan nameYesNone
    managerstringRelease manager usernameYesNone
    manager_identity_typestringRelease manager user type: system (default), ldap, oauth, etc.YesNone
    descriptionstringRequirement associationNoNone
    start_timeintRelease window - start timeNoNone
    end_timeintRelease window - end timeNoNone
    schedule_execute_timeintSchedule execution timeNoNone
    approvalapprovalApproval configuration, refer to custom workflow sectionNoNone
    jobs[]ReleasePlanJobRelease jobsNoNone

    ReleasePlanJob

    Parameter NameTypeDescription
    namestringRelease job name
    typestringRelease job type: text or workflow
    specReleaseJobSpecJob spec. If type=text, use TextReleasePlanJob; if type=workflow, use WorkflowReleasePlanJob

    TextReleasePlanJob

    Parameter NameTypeDescription
    contentstringContent
    remarkstringRemark

    WorkflowReleasePlanJob

    Parameter NameTypeDescription
    workflow_keystringWorkflow key
    project_keystringProject key
    parameters[]ParameterGlobal variables, see custom workflow section for detailed fields
    inputs[]InputWorkflow job inputs, see custom workflow section for detailed fields
    remarkstringRemark

    Body Parameter Example

    {
        "description": "test2",
        "parameters": [
            {
                "name": "test",
                "type": "string",
                "value": "zadig"
            },
            {
                "name": "abc",
                "type": "choice",
                "value": "123"
            },
            {
                "name": "repo1",
                "type": "repo",
                "repo": {
                    "codehost_name": "gitlab",
                    "repo_namespace": "kr-poc",
                    "repo_name": "num_test",
                    "branch": "master",
                    "prs": [ 1 ]
                }
            }
        ],
        "jobs": [
            {
                "name": "Text-1",
                "spec": {
                    "content": "Hello, World 1.",
                    "remark": "abc"
                },
                "type": "text"
            },
            {
                "name": "Workflow-1",
                "spec": {
                    "workflow_key": "old-hook",
                    "project_key": "yaml",
                    "remark": "remark-2",
                    "inputs": [
                        {
                            "job_name": "build",
                            "job_type": "zadig-build",
                            "parameters": {
                                "registry": "https://koderover.*********.com/test",
                                "service_list": [
                                    {
                                        "service_module": "service1",
                                        "service_name": "service1",
                                        "repo_info": [
                                            {
                                                "codehost_name": "gitlab",
                                                "repo_namespace": "kr-*****",
                                                "repo_name": "multi-service-demo",
                                                "branch": "patrick-01"
                                            }
                                        ],
                                        "inputs": [
                                            {
                                                "key": "gggg",
                                                "value": "abcd"
                                            }
                                        ]
                                    }
                                ]
                            }
                        },
                        {
                            "job_name": "deploy",
                            "job_type": "zadig-deploy",
                            "parameters": {
                                "env_name": "dev",
                                "service_list": [
                                    {
                                        "service_name": "service1",
                                        "service_module": "service1",
                                        "image_name": "https://koderover.*********.com/test/service1:main"
                                    }
                                ]
                            }
                        },
                        {
                            "job_name": "test",
                            "job_type": "zadig-test",
                            "parameters": {
                                "testing_list": [
                                    {
                                        "testing_name": "static-html-report",
                                        "repo_info": [
                                            {
                                                "codehost_name": "gitlab",
                                                "repo_namespace": "kr-******",
                                                "repo_name": "test-report",
                                                "branch": "main"
                                            }
                                        ]
                                    }
                                ]
                            }
                        }
                    ]
                },
                "type": "workflow"
            }
        ],
        "manager": "patrick",
        "manager_identity_type": "system",
        "name": "Test-Plan-1"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110

    ← Version ManagementArtifact Management→

    资源
    教程
    论坛
    博客
    公司
    关于
    客户故事
    加入我们
    联系我们
    微信扫一扫
    hello@koderover.com

    © 2026 筑栈(上海)信息技术有限公司 沪 ICP 备 19000177 号 - 1

    •  跟随系统
    •  浅色模式
    •  深色模式
    •  阅读模式